﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %> 
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditAlbumUserControl.ascx.cs" Inherits="JM.JCY.SharePointComponent.PhotoAlbum.EditAlbum.EditAlbumUserControl" %>

<script type="text/javascript">

    $(document).ready(function () {

        LoadContorls();
        $("#<%=txtAlbumDescription.ClientID %>").keypress(function (event) {
            var key = event.which;
            //all keys including return.
            if (key >= 33 || key == 13) {
                var maxLength = 256;
                var length = this.value.length;
                if (length >= maxLength) {
                    event.preventDefault();
                }
            }
        });
    });

    function LoadContorls() {
        var ImgBtnCancel = $("#<%=ImgBtnCancel.ClientID %>");
        var albumId = getParameterByName("AlbumId");

        ImgBtnCancel.live('click', function () {
            location.href = "ViewAlbum.aspx?AlbumId=" + albumId;
            return false;
        });
    }

    function getParameterByName(name) {
        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
        var regexS = "[\\?&]" + name + "=([^&#]*)";
        var regex = new RegExp(regexS);
        var results = regex.exec(window.location.href);
        if (results == null)
            return "";
        else
            return decodeURIComponent(results[1].replace(/\+/g, " "));
    }

</script>
<div id="divStep1">
    <table class="main" width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td valign="top" width="100%">
                <table class="content" width="99%">
                    <tr>
                        <td>
                            <div class="gallery">
                                <table width="100%" class="galleryTitle">
                                    <tr>
                                        <td width="60%">
                                            <h2 class="gallery">
                                                <img src="/_layouts/JM.JCY.Resource/images/相册小.png" width="24">
                                               修改相册</h2>
                                        </td>
                                        <td align="right" width="40%">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                                <br />
                                <table class="galleryHeader" width="100%">
                                    <tr>
                                        <td width="70%">
                                            修改相册
                                        </td>
                                        <td width="30%" align="right">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                                <table width="100%" class="galleryForm">
                                    <tr>
                                        <td width="19%">
                                            <span class="gallery">相册名称</span> <span class="mandatory">*</span>
                                        </td>
                                        <td width="1%">
                                            :
                                        </td>
                                        <td width="80%">
                                            <asp:TextBox ID="txtAlbumName" runat="server" MaxLength="50" Width="475px" Text="Jurong Bird Park"
                                                onkeydown="return (event.keyCode!=13);"></asp:TextBox>
                                            <br />
                                            <asp:RequiredFieldValidator ID="rfvAlbumName" runat="server" ErrorMessage="相册名称不能为空."
                                                ValidationGroup="Step1" ControlToValidate="txtAlbumName" CssClass="ms-formvalidation"
                                                Display="Dynamic"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="gallery">相册说明</span> <span class="mandatory">*</span>
                                        </td>
                                        <td>
                                            :
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtAlbumDescription" runat="server" Width="475px" Text="Photos of me in Jurong Bird Park last year"
                                                TextMode="MultiLine"></asp:TextBox>
                                            <br />
                                            <asp:RequiredFieldValidator ID="rfvAlbumDesc" runat="server" ErrorMessage="相册说明不能为空."
                                                ValidationGroup="Step1" ControlToValidate="txtAlbumDescription" CssClass="ms-formvalidation"
                                                Display="Dynamic"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" colspan="3">
                                            <asp:ImageButton ID="ImgBtnSave" runat="server" ValidationGroup="Step1" ImageUrl="/_layouts/JM.JCY.Resource/images/save.png"
                                                OnClick="ImgBtnSave_Click" />
                                            <asp:ImageButton ID="ImgBtnCancel" runat="server" ImageUrl="/_layouts/JM.JCY.Resource/images/cancel.png" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
                <br />
            </td>
        </tr>
    </table>
</div>